﻿using System;
using Autodesk.Revit.DB;
using QuickModel.QuickModelFrame;

namespace QuickModel.ColumnTransModel
{
	[Rebuilder(RebuilderName = "ColumnFamilySymbolRebuilder")]
	public class ColumnFamilySymbolRebuilder : IRevitModelRebuilder
	{
		public bool TryRebuildRevitModel(Autodesk.Revit.DB.Document inputDoc, RevitModelRequest inputReqeust, out BuildData createdElement)
		{
			createdElement = new BuildData();
			createdElement.NeedResponse = false;
			try
			{
				ColumnFamilySymbolRevitRequst columnFamilySymbolRevitRequst = inputReqeust as ColumnFamilySymbolRevitRequst;
				columnFamilySymbolRevitRequst.Config.ThisFamilySybmol = ColumnManager.CreateColumnSymbol(inputDoc, columnFamilySymbolRevitRequst.Config, columnFamilySymbolRevitRequst.LoopInfo);
			}
			catch (Exception)
			{
			}
			return true;
		}
	}
}
